package com.fqgj.sentry.policy.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.sentry.policy.dao.PcFunctionColumnDao;
import com.fqgj.sentry.policy.entity.PcFunctionColumnEntity;
import com.fqgj.sentry.policy.entity.PcPolicyEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * User: kennykong
 * Date: 2017-12-05
 * Time: 16:10:10.532
 */

@Repository
public class PcFunctionColumnDaoImpl extends AbstractBaseMapper<PcFunctionColumnEntity> implements PcFunctionColumnDao {

    @Override
    public List<PcFunctionColumnEntity> findByFunctionId(Long functionId) {
        return getSqlSession().selectList(getStatement("findByFunctionId"), functionId);

    }

    @Override
    public Boolean deleteByFunctionId(Long functionId) {
        return getSqlSession().delete(getStatement("deleteByFunctionId"), functionId) > 0;
    }

    @Override
    public Boolean updateDeletedByFunctionId(Long functionId) {
        return getSqlSession().delete(getStatement("updateDeletedByFunctionId"), functionId) > 0;
    }
}